home *** CD-ROM | disk | FTP | other *** search
- package test.ui;
-
- import java.awt.Button;
- import java.awt.Component;
- import java.awt.Container;
- import java.awt.Dialog;
- import java.awt.Font;
- import java.awt.Frame;
- import java.awt.GridBagConstraints;
- import java.awt.GridBagLayout;
- import java.awt.Insets;
- import java.awt.Label;
- import java.awt.Window;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.awt.event.WindowEvent;
- import java.awt.event.WindowListener;
- import java.lang.reflect.Constructor;
- import java.util.EventObject;
-
- class AboutDialog extends Dialog implements ActionListener, WindowListener {
- private Button ivjButton1;
- private Label ivjLabel1;
- private Label ivjLabel2;
- private Logo ivjLogo1;
- // $FF: synthetic field
- static Class class$java$awt$Window;
-
- public AboutDialog(Frame parent) {
- super(parent);
- this.initialize();
- }
-
- public AboutDialog(Frame parent, String title) {
- super(parent, title);
- }
-
- public AboutDialog(Frame parent, String title, boolean modal) {
- super(parent, title, modal);
- }
-
- public AboutDialog(Frame parent, boolean modal) {
- super(parent, modal);
- }
-
- public void actionPerformed(ActionEvent e) {
- if (((EventObject)e).getSource() == this.getButton1()) {
- this.conn1(e);
- }
-
- }
-
- private void conn0(WindowEvent arg1) {
- try {
- ((Window)this).dispose();
- } catch (Throwable ivjExc) {
- this.handleException(ivjExc);
- }
-
- }
-
- private void conn1(ActionEvent arg1) {
- try {
- ((Window)this).dispose();
- } catch (Throwable ivjExc) {
- this.handleException(ivjExc);
- }
-
- }
-
- private Button getButton1() {
- if (this.ivjButton1 == null) {
- try {
- this.ivjButton1 = new Button();
- this.ivjButton1.setName("Button1");
- this.ivjButton1.setLabel("Close");
- } catch (Throwable ivjExc) {
- this.handleException(ivjExc);
- }
- }
-
- return this.ivjButton1;
- }
-
- private Label getLabel1() {
- if (this.ivjLabel1 == null) {
- try {
- this.ivjLabel1 = new Label();
- this.ivjLabel1.setName("Label1");
- this.ivjLabel1.setFont(new Font("dialog", 1, 36));
- this.ivjLabel1.setText("JUnit");
- } catch (Throwable ivjExc) {
- this.handleException(ivjExc);
- }
- }
-
- return this.ivjLabel1;
- }
-
- private Label getLabel2() {
- if (this.ivjLabel2 == null) {
- try {
- this.ivjLabel2 = new Label();
- this.ivjLabel2.setName("Label2");
- this.ivjLabel2.setFont(new Font("dialog", 2, 14));
- this.ivjLabel2.setText("By Kent Beck and Erich Gamma");
- } catch (Throwable ivjExc) {
- this.handleException(ivjExc);
- }
- }
-
- return this.ivjLabel2;
- }
-
- private Logo getLogo1() {
- if (this.ivjLogo1 == null) {
- try {
- this.ivjLogo1 = new Logo();
- this.ivjLogo1.setName("Logo1");
- } catch (Throwable ivjExc) {
- this.handleException(ivjExc);
- }
- }
-
- return this.ivjLogo1;
- }
-
- private void handleException(Throwable exception) {
- }
-
- private void initConnections() {
- ((Window)this).addWindowListener(this);
- this.getButton1().addActionListener(this);
- }
-
- private void initialize() {
- GridBagConstraints constraintsLabel1 = new GridBagConstraints();
- GridBagConstraints constraintsLabel2 = new GridBagConstraints();
- GridBagConstraints constraintsButton1 = new GridBagConstraints();
- GridBagConstraints constraintsLogo1 = new GridBagConstraints();
- ((Component)this).setName("AboutDialog");
- ((Component)this).setName("AboutDialog");
- ((Dialog)this).setResizable(false);
- ((Container)this).setLayout(new GridBagLayout());
- ((Component)this).setSize(296, 138);
- ((Dialog)this).setTitle("About");
- constraintsLabel1.gridx = 3;
- constraintsLabel1.gridy = 0;
- constraintsLabel1.gridwidth = 1;
- constraintsLabel1.gridheight = 1;
- constraintsLabel1.anchor = 10;
- constraintsLabel1.weightx = (double)0.0F;
- constraintsLabel1.weighty = (double)0.0F;
- ((GridBagLayout)((Container)this).getLayout()).setConstraints(this.getLabel1(), constraintsLabel1);
- ((Container)this).add(this.getLabel1());
- constraintsLabel2.gridx = 2;
- constraintsLabel2.gridy = 1;
- constraintsLabel2.gridwidth = 2;
- constraintsLabel2.gridheight = 1;
- constraintsLabel2.anchor = 10;
- constraintsLabel2.weightx = (double)0.0F;
- constraintsLabel2.weighty = (double)0.0F;
- ((GridBagLayout)((Container)this).getLayout()).setConstraints(this.getLabel2(), constraintsLabel2);
- ((Container)this).add(this.getLabel2());
- constraintsButton1.gridx = 2;
- constraintsButton1.gridy = 2;
- constraintsButton1.gridwidth = 2;
- constraintsButton1.gridheight = 1;
- constraintsButton1.anchor = 10;
- constraintsButton1.weightx = (double)0.0F;
- constraintsButton1.weighty = (double)0.0F;
- constraintsButton1.insets = new Insets(8, 0, 8, 0);
- ((GridBagLayout)((Container)this).getLayout()).setConstraints(this.getButton1(), constraintsButton1);
- ((Container)this).add(this.getButton1());
- constraintsLogo1.gridx = 2;
- constraintsLogo1.gridy = 0;
- constraintsLogo1.gridwidth = 1;
- constraintsLogo1.gridheight = 1;
- constraintsLogo1.anchor = 10;
- constraintsLogo1.weightx = (double)0.0F;
- constraintsLogo1.weighty = (double)0.0F;
- ((GridBagLayout)((Container)this).getLayout()).setConstraints(this.getLogo1(), constraintsLogo1);
- ((Container)this).add(this.getLogo1());
- this.initConnections();
- }
-
- public static void main(String[] args) {
- try {
- AboutDialog aAboutDialog = new AboutDialog(new Frame());
- ((Dialog)aAboutDialog).setModal(true);
-
- try {
- Class aCloserClass = Class.forName("uvm.abt.edit.WindowCloser");
- Class[] parmTypes = new Class[]{class$java$awt$Window != null ? class$java$awt$Window : (class$java$awt$Window = class$("java.awt.Window"))};
- Object[] parms = new Object[]{aAboutDialog};
- Constructor aCtor = aCloserClass.getConstructor(parmTypes);
- aCtor.newInstance(parms);
- } catch (Throwable var6) {
- }
-
- ((Component)aAboutDialog).setVisible(true);
- } catch (Throwable var7) {
- System.err.println("Exception occurred in main() of java.awt.Dialog");
- }
-
- }
-
- public void windowActivated(WindowEvent e) {
- }
-
- public void windowClosed(WindowEvent e) {
- }
-
- public void windowClosing(WindowEvent e) {
- if (((EventObject)e).getSource() == this) {
- this.conn0(e);
- }
-
- }
-
- public void windowDeactivated(WindowEvent e) {
- }
-
- public void windowDeiconified(WindowEvent e) {
- }
-
- public void windowIconified(WindowEvent e) {
- }
-
- public void windowOpened(WindowEvent e) {
- }
-
- // $FF: synthetic method
- static Class class$(String class$) {
- try {
- return Class.forName(class$);
- } catch (ClassNotFoundException forName) {
- throw new NoClassDefFoundError(((Throwable)forName).getMessage());
- }
- }
- }
-